<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>异步编程的原理</title>
	</head>
	<body>
		<script type="text/javascript">
			// function say(value){
			// 	console.log(value);
			// };
			// function fn1(f1,f2){
			// 	f1(f2);
			// };
			// fn1(say,'hello');


			//回调函数1
			// function fn1(somefun,name){
			// 	somefun(name);
			// };
			// fn1( function(name1){console.log(name1)} , "111" );

			//回调函数2
			var fn1=function(callback){
				let a=1,
					b=2,
					c=3;
				let sum=callback(a,b,c);
				return sum+10;
			}
			var result=fn1(function(x,y,z){return x+y+z;});
			console.log(result);


			var fn1=function(a1){};
			var callback=function(x,y,z){return x+y+z;};
			//作用域 fn1
			//function callback
			//arg1=1；agr2=2；arg3=3；
			
		</script>
	</body>
</html>
